import java.util.*;
public class Main4
{
    public static void main(String[] args)
    {
         Scanner cin = new Scanner(System.in);
         int t = cin.nextInt();

         for(int k = 0;k<t;k++)
         {
             int a = cin.nextInt();
             int b = cin.nextInt();
             int c = cin.nextInt();

             if(a+b>c&&b+c>a&&a+c>b) {
                 if (a == b && b == c)
                     System.out.printf("Perfect\n");
                 else if (a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a)
                     System.out.printf("Very Good\n");
                 else if (a == b || b == c || a == c)
                     System.out.printf("Good\n");
                 else
                     System.out.printf("Ordinary\n");
             }
             else
             {
                 System.out.printf("Sorry\n");
             }
         }
         cin.close();
    }
}
